const { createProxyMiddleware } = require('http-proxy-middleware');

const targetIp1 = 'http://10.11.12.13:5000/';
const targetIp2 = 'http://localhost:8080/';
module.exports = function(app) {
	app.use(
		'/api1',
		createProxyMiddleware({
			target: targetIp1,
			changeOrigin: true,
			pathRewrite: {
				'^/api1': '',
			}
		})
	);
	//app.use(createProxyMiddleware('/api1', { target: 'http://10.11.12.13:5000/' }));
	app.use(createProxyMiddleware('/user', { target: targetIp2 }));
};